The invention relates to sine-wave generator circuits which generate sine-wave data based on input phase data represented by twos complements.
One type of sine-wave generator circuits is designed to use a read-only memory (i.e., ROM) which stores sine-wave data, so that the sine-wave data (or cosine-wave data) are generated based on input phase data. This type of sine-wave generator circuits does not store sine-wave data with respect to an overall phase region between 0 and 2.pi. because storage capacity of the ROM should be reduced. Instead, the sine-wave generator circuit stores sine-wave data with respect to a selected phase region between 0 and .pi./2, for example.
Suppose that one cycle of sine wave is divided into four sections which respectively correspond to four phase regions of 0 to .pi./2, .pi./2, to .pi. to 3.pi./2 and 3.pi./2 to 2.pi.. Each section of the sine wave can be represented by a curve having same curvature. Therefore, it is sufficient for the ROM to store only the sine-wave data in the phase region of 0 to .pi./2. So, sine-wave data of other phase regions can be easily obtained by adequately changing read addresses for the ROM as well as positive/negative signs of the sine-wave data which are read out from the ROM.
Input phase data are represented by twos-complement data in which each bit has a weight factor corresponding to phase. In the input phase data, a predetermined set of low-order bits are used as address data, whereas remaining high-order bits cooperate with sine/cosine-wave designation data to designate either a normal order or a reverse order, by which data are read out from the ROM, in accordance with the address data and in response to the phase region; and the high-order bits are also used to adjust phases of data read out from the ROM.
By the way, if sine-wave data of 0 to .pi./2, which are written into the ROM, are represented by mathematical expression of sin(n.pi./256) (where `n` is an integer selected from numbers ranging from 0 to 127), the sine-wave data, which are read out from the ROM, may not indicate a sinusoidal waveform with accuracy. This is because one cycle of phase (2n) is not equally divided. According to the above example, the sinusoidal waveform in each phase region is represented as follows: ##EQU1##
So, phase represented by the above equation for (.pi./2 to .pi.) if n.sub.1 =127 should be equal to phase represented by the equation for (.pi.to 3.pi./2) if n.sub.2 =0. Similarly, phase represented by the above equation for (0 to .pi./2) if n=0 should be equal to phase represented by the equation for (3.pi./2 to 2.pi.) if n.sub.3 =127.
In order to regenerate a sinusoidal waveform correctly, certain offset is applied to sampling phases in such a way that sine-wave data, which are written into the ROM, are represented by mathematical expression of sin{(n+0.5).pi./256}.
However, if the offset is applied to the sine-wave data, which are written into the ROM, in order to obtain output data representing a correct sinusoidal waveform, the offset will naturally cause an error in the output data. Theoretically, an error between the output data of the ROM and true data representing a true sine wave Is very small in the aforementioned example. Herein, a maximum error at positive side of the sine wave is represented by mathematical expression of -sin(0.5.pi./256); and a maximum error at negative side of the sine wave is represented by mathematical expression of -sin(0.5.pi./256). In addition, a phase error `d` is set within a region represented by an inequality as follows: EQU -0.5.pi./256.ltoreq.d.ltoreq.0.5.pi./256
So, an absolute value of the phase error is smaller than `1`. Actually, however, the aforementioned example divides the phase region of 0 to .pi./2 by `128`; therefore, the error may largely depend on resolution of address. So, as a distance between consecutive data within the input phase data becomes larger, the error becomes larger correspondingly.
Further, if n=0, the output data of the ROM should be equal to zero. However, in the aforementioned example, data of sin(0.5.pi./256) should be outputted instead of zero data. This will lead to incorrect regeneration of a sine wave.